<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button type="button">刷新页面</button>
<button id="back" type="button">back</button>
<button id="forward" type="button">forward</button>
<button id="go" type="button">go</button>
<script>
    console.log(window.location);

    document.querySelector("button").onclick = function () {
        window.location.reload();
    }

    document.querySelector("#back").onclick = function () {
        window.history.back();
    }
    document.querySelector("#forward").onclick = function () {
        window.history.forward();
    }
    document.querySelector("#go").onclick = function () {
        let index = prompt("输入历史记录编号？");
        console.log(index);
        window.history.go(parseInt(index));
    }

    console.log(window.navigator);
    console.log(window.screen);
</script>
</body>
</html>